<style>
    .icon{display: inline-block;width: 16px;height: 16px;cursor: pointer;
        border:solid 1px transparent;}
    #iconlist li{float: left;}
    .selected{border-color: #f00;}
</style>
<form id="info-form" method="post">
    <table style="padding-left: 20px">
        <input type="hidden" name="id" value="@if(!empty($info)) {{$info['id']}} @endif" />
        <tr style="height: 50px;">
            <td>按钮名称:</td>
            <td><input style="width:350px;height: 30px" class="easyui-textbox" type="text" name="name" data-options="required:true" value="@if(!empty($info)){{$info['name']}}@endif"/></td>
        </tr>
        <tr style="height: 50px">
            <td>code:</td>
            <td><input style="width:350px;height: 30px" class="easyui-textbox" type="text" name="code" data-options="required:true" value="@if(!empty($info)){{$info['code']}}@endif"/></td>
        </tr>
        <tr style="height: 50px">
            <td>图标样式:</td>
            <td><input id="icon_style" style="width:350px;height: 30px" class="easyui-textbox" type="text" name="icon_style" data-options="required:true" value="@if(!empty($info)){{$info['icon_style']}}@endif"/><i  onclick="openIcon()" class="icon icon-search" style="display: inline-block;width: 20px;height: 20px;cursor: pointer;"></i></td>
        </tr>
        <tr style="height: 50px">
            <td>方法名:</td>
            <td><input style="width:350px;height: 30px" class="easyui-textbox" type="text" name="func" data-options="required:true" value="@if(!empty($info)){{$info['func']}}@endif"/></td>
        </tr>
        <tr style="height: 50px">
            <td>是否生效:</td>
            <td><input type="text" name="is_active" @if(empty($info) || $info['is_active']) checked @endif class="easyui-switchbutton" data-options="onText:'是',offText:'否'" /></td>
        </tr>
    </table>
</form>

<div id="icon_dialog"></div>

<script>


    function  openIcon() {
        $('#icon_dialog').dialog({
            title: '选择图标',
            width: 400,
            height: 200,
            closed: false,
            cache: true,
            href: '/css/iconlist.html?v=' + Math.random() ,
            modal: true,
            buttons: [{
                text: '确定',
                iconCls: 'icon-ok',
                handler: function () {
                    $('#icon_style').textbox({value:$.trim($('.l-btn-icon-left').attr('data-selected-class'))});
                    $('#icon_dialog').dialog('close');
                }
            }, {
                text: '取消',
                iconCls: 'icon-cancel',
                handler: function () {
                    $('#icon_dialog').dialog('close');
                }
            }]
        });
    }
</script>
